package com.matt.domain.statistics;

import com.matt.foundation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Describle This Class Is
 * @Author ZengMin
 * @Date 2018/10/10 11:17
 */
@Data
@Table(name = "budget_templete")
@EqualsAndHashCode(callSuper = true)
@Entity
public class BudgetTemplete extends Domain {

    @Column(columnDefinition = " varchar(32) COMMENT '创建人id' ")
    private String staffId;

    @Column(columnDefinition = " varchar(32) COMMENT '模板名称' ")
    private String name;

    @Column(columnDefinition = " varchar(32) COMMENT '类型：1主动leads渠道 2被动leads渠道' ")
    private Integer type;

    @Column(columnDefinition = " varchar(32) COMMENT '类型中文' ")
    private String typeVal;

    @Column(columnDefinition = " varchar(32) COMMENT '父级类型：1市场2销售3运营4物业5教师6其他' ")
    private Integer parentId;

    @Column(columnDefinition = " varchar(32) COMMENT '父级类型中文' ")
    private String parentVal;

    @Column(columnDefinition = " varchar(32) COMMENT '园区id' ")
    private String areaId;

    @Column(columnDefinition = " int(11) DEFAULT 0 COMMENT '是否为crm专用模板1是0否' ")
    private Integer isCrm;

    @Column(columnDefinition = "int default 0 COMMENT '排序'")
    private Integer sort=0;

    public static BudgetTemplete of(String staffId,String name,Integer type,String typeVal,Integer parentId,String parentVal) {
        BudgetTemplete budgetTemplete = new BudgetTemplete();
        budgetTemplete.setStaffId(staffId);
        budgetTemplete.setName(name);
        budgetTemplete.setType(type);
        budgetTemplete.setParentId(parentId);
        budgetTemplete.setTypeVal(typeVal);
        budgetTemplete.setParentVal(parentVal);
        return budgetTemplete;
    }

}
